define(
    ["PDUtilDir/grid", "PDUtilDir/searchBlock", "PDUtilDir/slidebar"],
    function (Grid, SearchBlock, Slidebar) {

        function init(cache, searchObj) {
            SearchBlock.init('searchGroupFinanceBlockId');
            // 初始化
            return Grid({
                id: "GroupFinanceGirdDivId",
                pageSize: 10,
                index: true,
                multi: true,
                pagination: true,
                cache: false,
                layout: [
                    {
                        name: "团名称",
                        field: "groupName",
                        sort: true,
                        width: '220px'
                    }, {
                        name: "团编号",
                        field: "groupNo",
                        width: '160px',
                        sort: true
                    }, {
                        name: "团人数",
                        field: "personNum",
                        width: '70px',
                        sort: true
                    }/*, {
                        name: "总成本价",
                        width: '100px',
                        field: "totelCost",
                        sort: true
                    }, {
                        name: "总显示价",
                        width: '100px',
                        field: "realSale",
                        sort: true
                    }*/, {
                        name: "总利润",
                        width: '80px',
                        field: "profit",
                        sort: true
                    }, {
                        name: "状态",
                        field: "status",
                        sort: true,
                        width: '60px',
                        format: function (e) {
                            return cache.statusMap.get(e.row.status);
                        }
                    }, {
                        name: "负责人",
                        width: '60px',
                        field: "chargePerson"
                    }, {
                        name: "出团时间",
                        width: '120px',
                        field: "departureTime"
                    }, {
                        name: "操作",
                        field: "createTime",
                        sort: false,
                        width: '120px',
                        format: function (e) {
                            return '<a href="javascript:angular.element(\'#GroupFinanceGirdDivId\').scope().visitorSupport.run(\'' + e.row.id + '\')">游客订单列表</a>'
                                + '<a href="javascript:angular.element(\'#GroupFinanceGirdDivId\').scope().detailSupport.run(\'' + e.row.id + '\')">明细</a>';
                        }
                    }],
                toolbar: [/*
								 * { name : "封团", icon : "fa fa-search",
								 * callback : function(event) { closeObj.run(); } },
								 */{
                    name: "查询",
                    icon: "fa fa-search",
                    callback: function (event) {
                        searchObj.run();
                    }
                }],
                data: {
                    type: 'URL',
                    value: getServer()
                    // + '/flea/hclv/htravelGroup/listmygroup.htmls'
                    + '/flea/hclv/calFinance/calFinanceGroupByGroup.htmls'
                }
            });
        }

        return {
            init: init
        }
    });